import React from 'react';
import {Menu, Icon} from 'antd';

export default (props,clickFn) => {
  const {pathname} = props.location;
  
  const isPasswordPage = pathname === '/home/modifyPassword';
  const isIdentifyPage = pathname === '/home/identify';
  
  return (
    <Menu className="user-menu" onClick={clickFn}>
      <Menu.Item
        key="identify"
        style={{display: !isIdentifyPage ? 'block' : 'none'}}
      >
        资料修改
      </Menu.Item>
      <Menu.Item
        key="password"
        style={{display: !isPasswordPage ? 'block' : 'none'}}
      >
        修改密码 
      </Menu.Item>
      <Menu.Divider />
      <Menu.Item key="logout"><Icon type="logout" />退出登录</Menu.Item>
    </Menu>
  );
};
